package com.ding.mylib;

import java.util.HashMap;

public class TestMain2 {

    private static final String X32 = "0123456789ABCDEFGHJKLMNPRSTVWXYZ";
    private static final String[] X32_ARRAY = "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,J,K,L,M,N,P,R,S,T,V,W,X,Y,Z".split(",");

    public static String tenTo32(int num) {
        StringBuffer sBuffer = new StringBuffer();

        if(num == 0) {
            sBuffer.append("0");
        }
        while(num > 0) {
            sBuffer.append(X32_ARRAY[num % 32]);
            num = num / 32;
        }

        return sBuffer.reverse().toString();
    }


    public static void main(String[] args) {
        System.out.println(tenTo32(31));
    }

}
